package yqt.com.cnki.dao.impl;

import cnki.tpi.kbatis.sqlsession.SqlSession;
import cnki.tpi.kbatis.utils.DataSourceUtil;
import org.springframework.stereotype.Repository;
import yqt.com.cnki.bo.QBKJBo;
import yqt.com.cnki.dao.IQBKJDao;
import yqt.com.cnki.po.QBKJPo;

import java.util.List;

/**
 * Description:
 *
 * @author BaiGe
 * @date: 2021/12/28 14:22
 * @Version 1.0
 */
@Repository
public class QBKJDaoImpl implements IQBKJDao {
    @Override
    public List<QBKJPo> complexSearchQBKJ_List(QBKJBo qbkjBo) {
        SqlSession sqlSession = DataSourceUtil.getSqlSession();
        String statementId = "yqt.com.cnki.dao.IQBKJDao.complexSearchQBKJ_List";
        return sqlSession.selectList(statementId, qbkjBo, false);
    }

    @Override
    public long complexSearchQBKJ_Count(QBKJBo qbkjBo) {
        SqlSession sqlSession = DataSourceUtil.getSqlSession();
        String statementId = "yqt.com.cnki.dao.IQBKJDao.complexSearchQBKJ_Count";
        return sqlSession.getCount(statementId, qbkjBo);
    }

    @Override
    public QBKJPo findQBKJById(String sysId) {
        SqlSession sqlSession = DataSourceUtil.getSqlSession();
        String statementId = "yqt.com.cnki.dao.IQBKJDao.findQBKJById";
        return sqlSession.selectOne(statementId, sysId,false);
    }
}
